QT       -= gui
QT       += core network

DEPLOY_DIR = $${OUT_PWD}/../../../deploy
DEPLOY_INCLUDE_DIR = $$DEPLOY_DIR/include
DEPLOY_LIB_DIR = $$DEPLOY_DIR/lib
DEPLOY_BIN_DIR = $$DEPLOY_DIR/bin

TEMPLATE = lib
TARGET = protoqtrpc_location
DESTDIR = $$DEPLOY_LIB_DIR
DEPENDPATH += . src

CONFIG(android) {
    CONFIG += plugin
}

# Input
SOURCES = \
    src/LocationRpcServer.cpp \
    src/LocationRpcChannel.cpp \
    src/LocationServiceClient.cpp

ADDITIONAL_PROTO_PATHS = --proto_path=$$DEPLOY_INCLUDE_DIR
PROTODIR = $${PWD}/../proto
PROTOSUBDIR = protoqtrpc/location
PROTOS = \
        $$PROTODIR/$$PROTOSUBDIR/LocationService.proto

include ($${PWD}/../../../protobuf-compile.pri)

INCLUDEPATH += $$DEPLOY_INCLUDE_DIR
LIBS += -L$$DEPLOY_LIB_DIR -lprotoqtrpc

HEADERS += \
    src/LocationRpcServer.h \
    src/LocationRpcChannel.h \
    src/LocationServiceClient.h

QMAKE_POST_LINK += \
  mkdir -p $$DEPLOY_INCLUDE_DIR/protoqtrpc/location; \
  (cd $$PWD && $${QMAKE_COPY} $$HEADERS $$DEPLOY_INCLUDE_DIR/protoqtrpc/location);
